package com.juren.business.ibatis.controller;

import com.juren.business.ibatis.entity.Testibatis;
import com.juren.business.ibatis.service.ITestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import java.util.List;

/**
 * @author huxiangdong
 * @create 2018-12-19 11:45
 * @desc 前端控制器
 */
@Controller
@RequestMapping("/api/test")
public class TestibatisController {
    @Autowired
    private ITestService testService;

    @RequestMapping("/testlist")
    public ModelAndView testlist() throws Exception {

        ModelAndView mv = new ModelAndView();
        List<Testibatis> testibatis = testService.selectTest();
        mv.addObject("list",testibatis);
        mv.setViewName("list");
        return mv;
    }
}
